<?php

$this->load->view('layout/header', ["title"=> $name]);
?>

<table align="center" width="1000" cellpadding="0" cellspacing="1" style="border:1px solid #CCC">
  <tr bgcolor="#EEE" height="24">
    <td>接口地址</td>
    <td>method</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td><select id="api_host">
<?php
	foreach($hosts as $host){
?>
      <option value="<?php echo $host?>"><?php echo $host?></option>
<?php
	}
?>
    </select><?php echo $url?></td>
    <td><?php echo $method?></td>
  </tr>
</table>
<br>
<table align="center" width="1000" cellpadding="0" cellspacing="1" style="border:1px solid #CCC">
  <form id="requestform" method="<?php echo $method?>">
  <tr bgcolor="#EEE" height="24">
    <td>参数名</td>
    <td>参数</td>
    <td>必填</td>
    <td>类型</td>
    <td>说明</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td>km</td>
    <td><input name="km" type="text" value="5"/></td>
    <td>是</td>
    <td>number</td>
    <td>范围距离,单位km（千米）</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td>lat</td>
    <td><input name="lat" type="text" value="0"/></td>
    <td>是</td>
    <td>float</td>
    <td>纬度</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td>lng</td>
    <td><input name="lng" type="text" value="0"/></td>
    <td>是</td>
    <td>float</td>
    <td>经度</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td>level</td>
    <td><input name="level" type="text" value="0"/></td>
    <td>否</td>
    <td>string</td>
    <td>指定的行政区域级别</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td>pid</td>
    <td><input name="pid" type="text" value="0"/></td>
    <td>否</td>
    <td>int</td>
    <td>指定的行政区域父级id</td>
  </tr>
  <tr bgcolor="#F9F9F9" height="24">
    <td colspan="5" align="center"><input type="button" value="提交" onclick="request()"/></td>
  </tr>
  </form>
</table>
<script language="javascript">

function request(){
	
	var requestform = document.getElementById("requestform");
	var api_host = document.getElementById("api_host");
	
	requestform.action = api_host.value+"<?php echo $url?>";
	
	requestform.submit();
}


</script>
</body>
</html>